package com.example.patient.jpa;

import java.util.Date;
import java.util.List;

import com.example.common.entity.PlantOrder;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface PlantOrderRepository extends JpaRepository<PlantOrder, Long>{
    @Query(value = "select * from doctor_plant_order where dc_id_bigint = ?1 and plant_time_date >= ?2 and plant_time_date <= ?3 order by plant_time_date,time_type_tinyint",nativeQuery = true)
    List<PlantOrder> findDoctorPlant(Long dcid, Date beg, Date end);

    @Query(value = "select * from doctor_plant_order where dc_id_bigint = ?1 and plant_time_date = ?2 and time_type_tinyint = ?3",nativeQuery = true)
    PlantOrder findOneDoctorPlant(Long dcid, Date beg, Byte timeType);
}
